<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
OAuthToken (oauth-server 1.9 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="OAuthToken (oauth-server 1.9 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/OAuthToken.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthProvider.html" title="interface in com.sun.jersey.oauth.server.spi"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/sun/jersey/oauth/server/spi/OAuthToken.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="OAuthToken.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.sun.jersey.oauth.server.spi</FONT>
<BR>
Interface OAuthToken</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" title="class in com.sun.jersey.oauth.server.api.providers">DefaultOAuthProvider.Token</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>OAuthToken</B></DL>
</PRE>

<P>
Interface representing an OAuth token (i.e. access token or request token).
<P>

<P>
<DL>
<DT><B>Author:</B></DT>
  <DD>Martin Matula</DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/MultivaluedMap.html?is-external=true" title="class or interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getAttributes()">getAttributes</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns additional custom attributes associated with the token.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthConsumer.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthConsumer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getConsumer()">getConsumer</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns consumer this token was issued for.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.security.Principal</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getPrincipal()">getPrincipal</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>Principal</CODE> object containing the name of the
 user the request containing this token is authorized to act on behalf of.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getSecret()">getSecret</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the token secret.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getToken()">getToken</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns string representing the token.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#isInRole(java.lang.String)">isInRole</A></B>(java.lang.String&nbsp;role)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a boolean indicating whether this token is authorized for the
 specified logical "role".</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getToken()"><!-- --></A><H3>
getToken</H3>
<PRE>
java.lang.String <B>getToken</B>()</PRE>
<DL>
<DD>Returns string representing the token.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>string representing the token</DL>
</DD>
</DL>
<HR>

<A NAME="getSecret()"><!-- --></A><H3>
getSecret</H3>
<PRE>
java.lang.String <B>getSecret</B>()</PRE>
<DL>
<DD>Returns the token secret.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>token secret</DL>
</DD>
</DL>
<HR>

<A NAME="getConsumer()"><!-- --></A><H3>
getConsumer</H3>
<PRE>
<A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthConsumer.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthConsumer</A> <B>getConsumer</B>()</PRE>
<DL>
<DD>Returns consumer this token was issued for.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>consumer this token was issued for.</DL>
</DD>
</DL>
<HR>

<A NAME="getAttributes()"><!-- --></A><H3>
getAttributes</H3>
<PRE>
<A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/MultivaluedMap.html?is-external=true" title="class or interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt; <B>getAttributes</B>()</PRE>
<DL>
<DD>Returns additional custom attributes associated with the token.
 If this is a request token, this should be a the same set or a defined
 subset of parameters that were passed to the <CODE>OAuthProvider#newRequestToken(java.lang.String, java.lang.String, javax.ws.rs.core.MultivaluedMap)</CODE>
 method that created this request token. If this is an access token,
 this is any application defined set that will included as form parameters
 in a response to accessToken request.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>immutable map of custom attributes</DL>
</DD>
</DL>
<HR>

<A NAME="getPrincipal()"><!-- --></A><H3>
getPrincipal</H3>
<PRE>
java.security.Principal <B>getPrincipal</B>()</PRE>
<DL>
<DD>Returns a <CODE>Principal</CODE> object containing the name of the
 user the request containing this token is authorized to act on behalf of.
 When the oauth filter verifies the request
 with this token is properly authenticated, it injects this token into a security context
 which then delegates <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/SecurityContext.html?is-external=true#getUserPrincipal()" title="class or interface in javax.ws.rs.core"><CODE>SecurityContext.getUserPrincipal()</CODE></A> to this
 method.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>Principal corresponding to this token, or null if the token is not authorized</DL>
</DD>
</DL>
<HR>

<A NAME="isInRole(java.lang.String)"><!-- --></A><H3>
isInRole</H3>
<PRE>
boolean <B>isInRole</B>(java.lang.String&nbsp;role)</PRE>
<DL>
<DD>Returns a boolean indicating whether this token is authorized for the
 specified logical "role". When the oauth filter verifies the request
 with this token is properly authenticated, it injects this token into a security context
 which then delegates <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/SecurityContext.html?is-external=true#isUserInRole(java.lang.String)" title="class or interface in javax.ws.rs.core"><CODE>SecurityContext.isUserInRole(java.lang.String)</CODE></A> to this
 method.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>role</CODE> - a <code>String</code> specifying the name of the role
<DT><B>Returns:</B><DD>a <code>boolean</code> indicating whether this token is authorized for
 a given role</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/OAuthToken.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/sun/jersey/oauth/server/spi/OAuthProvider.html" title="interface in com.sun.jersey.oauth.server.spi"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/sun/jersey/oauth/server/spi/OAuthToken.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="OAuthToken.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2011 <a href="http://www.oracle.com/">Oracle Corporation</a>. All Rights Reserved.
</BODY>
</HTML>
